<div class="alert alert-info">
    版主或社区超级管理员不受条件控制
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">商城会员等级浏览权限</label>
    <div class="col-sm-9 col-xs-12 chks">

        {ife 'sns.board' $item}
        <select name='showlevels[]' class='form-control select2' multiple=''>
            <option value="0"  {if $item['showlevels']!='' && is_array($item['showlevels'])  && in_array('0', $item['showlevels'])}selected{/if}>普通等级</option>
            {loop $levels $level}
            <option value="{$level['id']}" {if is_array($item['showlevels']) && in_array($level['id'], $item['showlevels'])}selected{/if}>{$level['levelname']}</option>
            {/loop}
        </select>
        <span class='help-block'>不设置默认全部会员等级</span>

        {else}
        <div class='form-control-static'>
            {if $item['showlevels']==''}
            全部会员等级
            {else}
            {if $item['showlevels']!='' && is_array($item['showlevels']) && in_array('0', $item['showlevels'])}
            {php echo empty($shop['levelname'])?'普通等级':$shop['levelname']};
            {/if}
            {loop $levels $level}
            {if $item['showlevels']!='' && is_array($item['showlevels']) && in_array($level['id'], $item['showlevels'])}
            {$level['levelname']};
            {/if}
            {/loop}
            {/if}
        </div>

        {/if}
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">商城会员等级发帖权限</label>
    <div class="col-sm-9 col-xs-12 chks">
        {ife 'sns.board' $item}
        <select name='postlevels[]' class='form-control select2' multiple=''>

            <option value="0"  {if $item['postlevels']!='' && is_array($item['postlevels'])  && in_array('0', $item['postlevels'])}selected{/if}>普通等级</option>
            {loop $levels $level}
            <option value="{$level['id']}" {if is_array($item['postlevels']) && in_array($level['id'], $item['postlevels'])}selected{/if}>{$level['levelname']}</option>
            {/loop}
        </select>
        <span class='help-block'>不设置默认全部会员等级</span>
        {else}
        <div class='form-control-static'>
            {if $item['postlevels']==''}
            全部会员等级
            {else}
            {if $item['postlevels']!='' && is_array($item['postlevels']) && in_array('0', $item['postlevels'])}
            {php echo empty($shop['levelname'])?'普通等级':$shop['levelname']};
            {/if}
            {loop $levels $level}
            {if $item['postlevels']!='' && is_array($item['postlevels']) && in_array($level['id'], $item['postlevels'])}
            {$level['levelname']};
            {/if}
            {/loop}
            {/if}
        </div>

        {/if}


    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">商城会员组浏览权限</label>
    <div class="col-sm-9 col-xs-12 chks">
        {ife 'sns.board' $item}
        <select name='showgroups[]' class='form-control select2' multiple=''>
            <option value="0" {if $item['showgroups']!='' && is_array($item['showgroups']) && in_array('0',$item['showgroups'])}selected{/if}>无分组</option>
            {loop $groups $group}
            <option value="{$group['id']}" {if is_array($item['showgroups']) && in_array($group['id'], $item['showgroups'])}selected{/if}>{$group['groupname']}</option>
            {/loop}
        </select>
        <span class='help-block'>不设置默认全部会员分组</span>

        {else}
        <div class='form-control-static'>
            {if $item['showgroups']==''}
            全部会员等级
            {else}
            {if $item['showgroups']!='' && is_array($item['showgroups']) && in_array('0', $item['showgroups'])}
            {php echo empty($shop['levelname'])?'普通等级':$shop['levelname']};
            {/if}
            {loop $levels $level}
            {if $item['showgroups']!='' && is_array($item['showgroups']) && in_array($level['id'], $item['showgroups'])}
            {$level['levelname']};
            {/if}
            {/loop}
            {/if}
        </div>

        {/if}

    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">商城会员组发帖权限</label>
    <div class="col-sm-9 col-xs-12 chks">
        {ife 'sns.board' $item}
        <select name='postgroups[]' class='form-control select2' multiple=''>
            <option value="0" {if $item['postgroups']!='' && is_array($item['postgroups']) && in_array('0',$item['postgroups'])}selected{/if}>无分组</option>
            {loop $groups $group}
            <option value="{$group['id']}" {if is_array($item['postgroups']) && in_array($group['id'], $item['postgroups'])}selected{/if}>{$group['groupname']}</option>
            {/loop}
        </select>
        <span class='help-block'>不设置默认全部会员分组</span>
        {else}
        <div class='form-control-static'>
            {if $item['postgroups']==''}
            全部会员等级
            {else}
            {if $item['postgroups']!='' && is_array($item['postgroups']) && in_array('0', $item['postgroups'])}
            {php echo empty($shop['levelname'])?'普通等级':$shop['levelname']};
            {/if}
            {loop $levels $level}
            {if $item['postgroups']!='' && is_array($item['postgroups']) && in_array($level['id'], $item['postgroups'])}
            {$level['levelname']};
            {/if}
            {/loop}
            {/if}
        </div>

        {/if}

    </div>
</div>



<div class="form-group">
    <label class="col-sm-2 control-label">社区会员等级浏览权限</label>
    <div class="col-sm-9 col-xs-12 chks">

        {ife 'sns.board' $item}
        <select name='showsnslevels[]' class='form-control select2' multiple=''>
            <option value="0"  {if $item['showsnslevels']!='' && is_array($item['showsnslevels'])  && in_array('0', $item['showsnslevels'])}selected{/if}>{php echo empty($this->set['levelname'])?'社区粉丝':$this->set['levelname']}</option>
            {loop $snslevels $level}
            <option value="{$level['id']}" {if is_array($item['showsnslevels']) && in_array($level['id'], $item['showsnslevels'])}selected{/if}>{$level['levelname']}</option>
            {/loop}
        </select>
        <span class='help-block'>不设置默认全部会员等级</span>

        {else}
        <div class='form-control-static'>
            {if $item['showlevels']==''}
            全部会员等级
            {else}
            {if $item['showsnslevels']!='' && is_array($item['showsnslevels']) && in_array('0', $item['showsnslevels'])}
            {php echo empty($shop['levelname'])?(empty($this->set['levelname'])?'社区粉丝':$this->set['levelname']):$shop['levelname']};
            {/if}
            {loop $snslevels $level}
            {if $item['showlevels']!='' && is_array($item['showsnslevels']) && in_array($level['id'], $item['showsnslevels'])}
            {$level['levelname']};
            {/if}
            {/loop}
            {/if}
        </div>

        {/if}
    </div>
</div>


<div class="form-group">
    <label class="col-sm-2 control-label">社区会员等级发帖权限</label>
    <div class="col-sm-9 col-xs-12 chks">

        {ife 'sns.board' $item}
        <select name='postsnslevels[]' class='form-control select2' multiple=''>
            <option value="0"  {if $item['postsnslevels']!='' && is_array($item['postsnslevels'])  && in_array('0', $item['postsnslevels'])}selected{/if}>{php echo empty($this->set['levelname'])?'社区粉丝':$this->set['levelname']}</option>
            {loop $snslevels $level}
            <option value="{$level['id']}" {if is_array($item['postsnslevels']) && in_array($level['id'], $item['postsnslevels'])}selected{/if}>{$level['levelname']}</option>
            {/loop}
        </select>
        <span class='help-block'>不设置默认全部会员等级</span>

        {else}
        <div class='form-control-static'>
            {if $item['showlevels']==''}
            全部会员等级
            {else}
            {if $item['postsnslevels']!='' && is_array($item['postsnslevels']) && in_array('0', $item['postsnslevels'])}
            {php echo empty($shop['levelname'])?(empty($this->set['levelname'])?'社区粉丝':$this->set['levelname']):$shop['levelname']};
            {/if}
            {loop $snslevels $level}
            {if $item['postsnslevels']!='' && is_array($item['postsnslevels']) && in_array($level['id'], $item['postsnslevels'])}
            {$level['levelname']};
            {/if}
            {/loop}
            {/if}
        </div>

        {/if}
    </div>
</div>